{% extends 'boot/ghost_green.html'%}

{% block blog-title %}{{ articles_slug.title }}{% endblock %}

{% block ghost-article %}
    <article id ='97' class="post">
        <div class="post-head">
            <h1 class="post-title">{{ articles_slug.title }}</h1>
            <div class="post-meta">
                <span class="author">标签：{{ articles_slug.categories.get }}</span>
                <span class="author">阅读量：{{ articles_slug.read_num }}</span>
                <time class="post-date">发布时间：{{ articles_slug.date_publish|date:"SHORT_DATE_FORMAT" }}</time>
            </div>
        </div>
        <div class="post-content">
            {{ articles_slug.content_markup|safe}}
        </div>
    </article>
    <div class="comment">
        {% for comment in comments %}
        <div class="main-content">
            <span class="user-nickname">{{ comment.user_name}}</span>
            <time class="time">{{ comment.date_publish|date:"SHORT_DATE_FORMAT" }}</time>
            <div class="comment-content">
                <p>{{ comment.text }}</p>
            </div>
        </div>
        {% endfor %}
        <div class="comment-main">
            {% if error %}
            <p>{{ error }}</p>
            {% endif %}
            <form method="post" action="">
                {% csrf_token %}
                    {% for field in form %}
                        {{ field }}
                        {{ field.errors }}
                        <br>
                    {% endfor %}
                <button class="btn btn-default" type="submit">发表评论</button>
            </form>
        </div>
    </div>

{% endblock %}
